Installation
$ npm install -g db-migrate
DB-Migrate is now available to you via:
$ db-migrate
As local module
Want to use db-migrate as local module?
$ npm install db-migrate
DB-Migrate is now available to you via:
$ node node_modules/db-migrate/bin/db-migrate
Basic Usage
Usage: db-migrate [up|down|reset|create|db] [[dbname/]migrationName|all] [options]
Down migrations are run in reverse run order, so migrationName is ignored for down migrations.
Use the --count option to control how many down migrations are run (default is 1).
Options:
--env, -e The environment to run the migrations under. [default: "dev"]
--migrations-dir, -m The directory containing your migration files. [default: "./migrations"]
--count, -c Max number of migrations to run.
--dry-run Prints the SQL but doesn't run it. [boolean]
--verbose, -v Verbose mode. [default: false]
--config Location of the database.json file. [default: "./database.json"]
--force-exit Call system.exit() after migration run [default: false]
--sql-file Create sql files for up and down. [default: false]
--coffee-file Create a coffeescript migration file [default: false]
--migration-table Set the name of the migration table.
--table, --migration-table [default: "migrations"]